<template>
  <div class="card-main">
    <div class="title">
      {{title}}
      <Icon v-if="refresh === 'true'" type="ios-refresh" size="25" style="float:right; cursor: pointer;" @click.native="handleClick"/>
      <!-- <Button icon="ios-refresh"/> -->
    </div>
    <slot></slot>
  </div>  
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: '标题'
    },
    refresh: {
      type: String,
      default: "false"
    }
    // desc: {
    //   type: String,
    //   default: '描述'
    // },
  },
  methods:{
    handleClick() {
      this.$emit("refreshMethod");
    }
  }
};
</script>

<style lang='less'>
.card-main {
  border-radius: 8px;
  background: #fff;
  margin-bottom: 20px;
  padding-bottom: 10px;
}
.title {
  letter-spacing: normal;
  color: #666666;
  font-family: '微软雅黑 Bold', '微软雅黑 Regular', '微软雅黑', sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 16px;
  padding: 20px 32px;
  span {
    padding-left: 17px;
    font-size: 12px;
    color: #dededf;
  }
}
</style>
